<template>

    <div class="brand-wrapper">
        <!--导航头-->
        <div style="margin-top: 10px">
            <el-breadcrumb separator-class="el-icon-arrow-right" style="font-size: 15px">
                <el-breadcrumb-item>B2C销售管理</el-breadcrumb-item>
                <el-breadcrumb-item>销售订单管理</el-breadcrumb-item>
                <el-breadcrumb-item>添加订单</el-breadcrumb-item>
            </el-breadcrumb>
        </div>
        <!--分割线-->
        <el-divider></el-divider>


        <div align="center">
            <el-form ref="formIndentData" :model="formIndentData" label-width="120px" :inline="true">
                <el-form-item label="收货人姓名">
                    <el-input v-model="formIndentData.consigneeName" placeholder="请输入收货人姓名"></el-input>
                </el-form-item>
                <el-form-item label="会员账号">
                    <el-input v-model="formIndentData.vipNumber" placeholder="请输入会员账号"></el-input>
                </el-form-item><br>
                <el-form-item label="联系电话">
                    <el-input v-model="formIndentData.telephone" placeholder="请输入联系电话"></el-input>
                </el-form-item>
                <el-form-item label="联系手机">
                    <el-input v-model="formIndentData.cellphone" placeholder="请输入联系手机"></el-input>
                </el-form-item><br>
                <el-form-item label="邮政编码">
                    <el-input v-model="formIndentData.postcode" placeholder="请输入邮政编码"></el-input>
                </el-form-item>
                <el-form-item label="收货人地址">
                    <el-input v-model="formIndentData.consigneeAddress" placeholder="请输入收货人地址"></el-input>
                </el-form-item><br>
                <el-form-item label="配送地区">
                    <el-input v-model="formIndentData.shippingRegion" placeholder="请输入配送地区"></el-input>
                </el-form-item>
                <el-form-item label="配送费用">
                    <el-input v-model="formIndentData.shippingMoney" placeholder="请输入配送费用"></el-input>
                </el-form-item><br>
                <el-form-item label="电子邮箱">
                    <el-input v-model="formIndentData.email" placeholder="请输入电子邮箱"></el-input>
                </el-form-item>
                <el-form-item label="汇款人">
                    <el-input v-model="formIndentData.remitter" placeholder="请输入汇款人"></el-input>
                </el-form-item><br>
                <el-form-item label="订单类型">
                    <el-select v-model="formIndentData.indentType" placeholder="请选择订单类型">
                        <el-option label="电话订单" value="电话订单"></el-option>
                        <el-option label="网络订单" value="电话订单"></el-option>
                        <el-option label="网络订单" value="电话订单"></el-option>
                    </el-select>
                </el-form-item>
                <el-form-item label="订单动作">
                    <el-select v-model="formIndentData.indentAction" placeholder="请选择订单动作">
                        <el-option label="订购" value="shanghai"></el-option>
                        <el-option label="换购" value="beijing"></el-option>
                        <el-option label="支付" value="beijing"></el-option>
                    </el-select>
                </el-form-item><br>
                    <el-form-item label="订单状态">
                        <el-select v-model="formIndentData.indentState" placeholder="请选择订单状态">
                            <el-option label="审核通过" value="审核通过"></el-option>
                            <el-option label="已付款" value="已付款"></el-option>
                            <el-option label="已出库" value="已出库"></el-option>
                        </el-select>
                    </el-form-item>
                    <el-form-item label="配送方式">
                        <el-select v-model="formIndentData.shippingType" placeholder="请选择配送方式">
                            <el-option label="EMS" value="EMS"></el-option>
                            <el-option label="其它" value="其它"></el-option>
                        </el-select>
                    </el-form-item><br>
                    <el-form-item label="支付方式">
                        <el-select v-model="formIndentData.payType" placeholder="请选择支付方式">
                            <el-option label="货到付款" value="货到付款"></el-option>
                            <el-option label="款到发货" value="款到发货"></el-option>
                        </el-select>
                    </el-form-item>
                <el-form-item label="备注">
                    <el-input type="textarea" v-model="formIndentData.remark"></el-input>
                </el-form-item><br>
                <div class="block" style="margin-right: 270px;" >
                    <span class="demonstration" >下单时间</span> &nbsp;
                    <el-date-picker
                            v-model="formIndentData.indentDate"
                            type="datetime"
                            placeholder="选择日期时间"
                            value-format="yyyy-MM-dd HH:mm:ss">
                    </el-date-picker>
                </div>
                <div class="block" style="margin-top: -40px;margin-left: 370px;margin-bottom: 20px" >
                    <span class="demonstration">自提时间</span> &nbsp;
                    <el-date-picker
                            v-model="formIndentData.afhalenTime"
                            type="datetime"
                            placeholder="选择日期时间"
                            value-format="yyyy-MM-dd HH:mm:ss">
                    </el-date-picker>
                </div>
            </el-form>
            <!--操作按钮-->
            <div>
               <span slot="footer" class="dialog-footer" style="text-align: center">
                    <el-button size="mini"  @click="dialogVisibleTwo=true,searchPage()" style="margin-right: 20px">选择商品</el-button>
                    <el-button size="mini" type="danger" @click="dialogVisibleTwo=false;insertIndent();" style="margin-right: 20px">确定</el-button>
                    <router-link :to="{path:'/market'}">
                            <el-button size="mini" type="success" >返回</el-button>
                        </router-link>

                </span>
            </div>
        </div>

        <!--商品弹框-->
        <div>
            <!--弹框-->
            <el-dialog  :visible.sync="dialogVisibleTwo" width="33%">
                <!--搜索框-->
                <el-form :inline="true" class="demo-form-inline" size="mini">
                    <el-form-item >
                    <el-input v-model="searchData.goodsName" style="width: 180px" placeholder="请输入商品名称"></el-input>
                    </el-form-item>

                    <el-form-item style="margin-left: 10px">
                        <!--<el-button type="primary" @click="dialogVisible=true,formData={},addIndent()">新增</el-button>-->
                        <el-button type="danger" @click="findIndentBylike">搜索</el-button>
                        <el-button type="danger" @click="reset">重置</el-button>
                        <el-button type="success" size="mini" :disabled="formCountIndentData.batchIds.length<=0"
                                   @click="open" style="margin-right: 5px">添加商品到订单
                        </el-button>
                    </el-form-item>
                </el-form>

                <!--表格-->
                <el-table
                        :data="tableData"
                        style="width: 100%"
                        @selection-change="selectChange">
                    <!--多选框-->
                    <el-table-column
                            align="center"
                            type="selection"
                            width="55">
                    </el-table-column>
                    <el-table-column
                            prop="goodsId"
                            label="商品编号"
                            width="140">
                    </el-table-column>
                    <el-table-column
                            prop="goodsName"
                            label="商品名称"
                            width="140">
                    </el-table-column>
                    <el-table-column
                            prop="salePrice"
                            label="单价">
                    </el-table-column>
                </el-table>

                <!--    分页-->
                <div class="page-box">
                    <el-pagination
                            background
                            layout="prev, pager, next"
                            :total="total"
                            :page-size="searchData.pageSize"
                            :current-page="searchData.currentPage"
                            @current-change="currentPageChange"
                            align="right">
                    </el-pagination>

                </div>
                <!--操作按钮-->
                <span slot="footer" class="dialog-footer" style="text-align: center">
                    <el-button size="mini" type="success" @click="dialogVisibleTwo = false">确认</el-button>
                    <el-button size="mini" type="success" @click="dialogVisibleTwo = false">返回</el-button>
                </span>
            </el-dialog>
        </div>



    </div>
</template>

<script>
    import market from "./index";

    export default market;
</script>

<!--src 引用css样式-->
<style src="./index.scss" lang="scss"></style>